.class public Lcom/netease/newsreader/view/LoadingListView;
.super Landroid/widget/FrameLayout;
.source "LoadingListView.java"


# static fields
.field private static final STATE_INIT:I = 0x0

.field private static final STATE_LOADING:I = 0x1


# instance fields
.field private mEmptyView:Landroid/view/View;

.field private mListView:Landroid/widget/ListView;

.field private mLoadingMoreView:Landroid/view/View;

.field private mLoadingView:Landroid/view/View;

.field private mPage:I

.field private mState:I

.field private mTempPage:I


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter "context"

    .prologue
    const/4 v0, 0x1

    .line 41
    invoke-direct {p0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    .line 26
    iput v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mPage:I

    .line 28
    iput v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mTempPage:I

    .line 30
    const/4 v0, 0x0

    iput v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mState:I

    .line 42
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .parameter "context"
    .parameter "attrs"

    .prologue
    const/4 v0, 0x1

    .line 37
    invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 26
    iput v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mPage:I

    .line 28
    iput v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mTempPage:I

    .line 30
    const/4 v0, 0x0

    iput v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mState:I

    .line 38
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 1
    .parameter "context"
    .parameter "attrs"
    .parameter "defStyle"

    .prologue
    const/4 v0, 0x1

    .line 33
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 26
    iput v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mPage:I

    .line 28
    iput v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mTempPage:I

    .line 30
    const/4 v0, 0x0

    iput v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mState:I

    .line 34
    return-void
.end method

.method private setViewEnabled(Landroid/view/View;Z)V
    .locals 0
    .parameter "view"
    .parameter "enabled"

    .prologue
    .line 146
    if-eqz p1, :cond_0

    .line 147
    invoke-virtual {p1, p2}, Landroid/view/View;->setEnabled(Z)V

    .line 149
    :cond_0
    return-void
.end method

.method private setViewVisibility(Landroid/view/View;I)V
    .locals 0
    .parameter "view"
    .parameter "visibility"

    .prologue
    .line 140
    if-eqz p1, :cond_0

    .line 141
    invoke-virtual {p1, p2}, Landroid/view/View;->setVisibility(I)V

    .line 143
    :cond_0
    return-void
.end method


# virtual methods
.method public completeLoading(ZZ)V
    .locals 4
    .parameter "success"
    .parameter "hasMore"

    .prologue
    const/16 v2, 0x8

    const/4 v1, 0x0

    .line 111
    iput v1, p0, Lcom/netease/newsreader/view/LoadingListView;->mState:I

    .line 112
    iget-object v3, p0, Lcom/netease/newsreader/view/LoadingListView;->mListView:Landroid/widget/ListView;

    if-eqz p1, :cond_0

    move v0, v1

    :goto_0
    invoke-direct {p0, v3, v0}, Lcom/netease/newsreader/view/LoadingListView;->setViewVisibility(Landroid/view/View;I)V

    .line 113
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingView:Landroid/view/View;

    invoke-direct {p0, v0, v2}, Lcom/netease/newsreader/view/LoadingListView;->setViewVisibility(Landroid/view/View;I)V

    .line 114
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingMoreView:Landroid/view/View;

    if-eqz p1, :cond_1

    if-eqz p2, :cond_1

    :goto_1
    invoke-direct {p0, v0, v1}, Lcom/netease/newsreader/view/LoadingListView;->setViewVisibility(Landroid/view/View;I)V

    .line 115
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingMoreView:Landroid/view/View;

    const/4 v1, 0x1

    invoke-direct {p0, v0, v1}, Lcom/netease/newsreader/view/LoadingListView;->setViewEnabled(Landroid/view/View;Z)V

    .line 116
    return-void

    :cond_0
    move v0, v2

    .line 112
    goto :goto_0

    :cond_1
    move v1, v2

    .line 114
    goto :goto_1
.end method

.method public completeLoadingMore(ZZ)V
    .locals 4
    .parameter "success"
    .parameter "hasMore"

    .prologue
    const/16 v2, 0x8

    const/4 v1, 0x0

    .line 131
    iput v1, p0, Lcom/netease/newsreader/view/LoadingListView;->mState:I

    .line 132
    if-eqz p1, :cond_0

    if-eqz p2, :cond_0

    iget v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mTempPage:I

    :goto_0
    iput v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mPage:I

    .line 133
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mListView:Landroid/widget/ListView;

    invoke-direct {p0, v0, v1}, Lcom/netease/newsreader/view/LoadingListView;->setViewVisibility(Landroid/view/View;I)V

    .line 134
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingView:Landroid/view/View;

    invoke-direct {p0, v0, v2}, Lcom/netease/newsreader/view/LoadingListView;->setViewVisibility(Landroid/view/View;I)V

    .line 135
    iget-object v3, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingMoreView:Landroid/view/View;

    if-eqz p2, :cond_1

    move v0, v1

    :goto_1
    invoke-direct {p0, v3, v0}, Lcom/netease/newsreader/view/LoadingListView;->setViewVisibility(Landroid/view/View;I)V

    .line 136
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingMoreView:Landroid/view/View;

    const/4 v1, 0x1

    invoke-direct {p0, v0, v1}, Lcom/netease/newsreader/view/LoadingListView;->setViewEnabled(Landroid/view/View;Z)V

    .line 137
    return-void

    .line 132
    :cond_0
    iget v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mPage:I

    goto :goto_0

    :cond_1
    move v0, v2

    .line 135
    goto :goto_1
.end method

.method public getEmptyView()Landroid/view/View;
    .locals 1

    .prologue
    .line 82
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mEmptyView:Landroid/view/View;

    return-object v0
.end method

.method public getListView()Landroid/widget/ListView;
    .locals 1

    .prologue
    .line 70
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mListView:Landroid/widget/ListView;

    return-object v0
.end method

.method public getLoadingMoreView()Landroid/view/View;
    .locals 1

    .prologue
    .line 78
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingMoreView:Landroid/view/View;

    return-object v0
.end method

.method public getLoadingView()Landroid/view/View;
    .locals 1

    .prologue
    .line 74
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingView:Landroid/view/View;

    return-object v0
.end method

.method public getPage()I
    .locals 1

    .prologue
    .line 86
    iget v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mPage:I

    return v0
.end method

.method public inLoading()Z
    .locals 1

    .prologue
    .line 66
    iget v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mState:I

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method protected onFinishInflate()V
    .locals 2

    .prologue
    .line 46
    invoke-super {p0}, Landroid/widget/FrameLayout;->onFinishInflate()V

    .line 47
    const v0, 0x7f0c00cc

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/view/LoadingListView;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ListView;

    iput-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mListView:Landroid/widget/ListView;

    .line 48
    const v0, 0x7f0c00cd

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/view/LoadingListView;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingView:Landroid/view/View;

    .line 49
    const v0, 0x7f0c000f

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/view/LoadingListView;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mEmptyView:Landroid/view/View;

    .line 50
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mListView:Landroid/widget/ListView;

    iget-object v1, p0, Lcom/netease/newsreader/view/LoadingListView;->mEmptyView:Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setEmptyView(Landroid/view/View;)V

    .line 51
    return-void
.end method

.method public reset()V
    .locals 4

    .prologue
    const/4 v3, 0x0

    const/16 v2, 0x8

    .line 54
    iput v3, p0, Lcom/netease/newsreader/view/LoadingListView;->mState:I

    .line 55
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mListView:Landroid/widget/ListView;

    if-eqz v0, :cond_0

    .line 56
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mListView:Landroid/widget/ListView;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 59
    :cond_0
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mListView:Landroid/widget/ListView;

    invoke-direct {p0, v0, v2}, Lcom/netease/newsreader/view/LoadingListView;->setViewVisibility(Landroid/view/View;I)V

    .line 60
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingView:Landroid/view/View;

    invoke-direct {p0, v0, v2}, Lcom/netease/newsreader/view/LoadingListView;->setViewVisibility(Landroid/view/View;I)V

    .line 61
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingMoreView:Landroid/view/View;

    invoke-direct {p0, v0, v2}, Lcom/netease/newsreader/view/LoadingListView;->setViewVisibility(Landroid/view/View;I)V

    .line 62
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingMoreView:Landroid/view/View;

    invoke-direct {p0, v0, v3}, Lcom/netease/newsreader/view/LoadingListView;->setViewEnabled(Landroid/view/View;Z)V

    .line 63
    return-void
.end method

.method public setLoadingMoreView(Landroid/view/View;)V
    .locals 0
    .parameter "view"

    .prologue
    .line 90
    iput-object p1, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingMoreView:Landroid/view/View;

    .line 91
    return-void
.end method

.method public startLoading(Z)V
    .locals 4
    .parameter "isFirst"

    .prologue
    const/16 v1, 0x8

    const/4 v3, 0x1

    const/4 v2, 0x0

    .line 94
    invoke-virtual {p0}, Lcom/netease/newsreader/view/LoadingListView;->inLoading()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 102
    :goto_0
    return-void

    .line 97
    :cond_0
    iput v3, p0, Lcom/netease/newsreader/view/LoadingListView;->mState:I

    .line 98
    iput v3, p0, Lcom/netease/newsreader/view/LoadingListView;->mTempPage:I

    iput v3, p0, Lcom/netease/newsreader/view/LoadingListView;->mPage:I

    .line 99
    iget-object v3, p0, Lcom/netease/newsreader/view/LoadingListView;->mListView:Landroid/widget/ListView;

    if-eqz p1, :cond_2

    move v0, v1

    :goto_1
    invoke-direct {p0, v3, v0}, Lcom/netease/newsreader/view/LoadingListView;->setViewVisibility(Landroid/view/View;I)V

    .line 100
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingView:Landroid/view/View;

    if-eqz p1, :cond_1

    move v1, v2

    :cond_1
    invoke-direct {p0, v0, v1}, Lcom/netease/newsreader/view/LoadingListView;->setViewVisibility(Landroid/view/View;I)V

    .line 101
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingMoreView:Landroid/view/View;

    invoke-direct {p0, v0, v2}, Lcom/netease/newsreader/view/LoadingListView;->setViewEnabled(Landroid/view/View;Z)V

    goto :goto_0

    :cond_2
    move v0, v2

    .line 99
    goto :goto_1
.end method

.method public startLoadingMore(I)V
    .locals 3
    .parameter "page"

    .prologue
    const/4 v2, 0x0

    .line 119
    invoke-virtual {p0}, Lcom/netease/newsreader/view/LoadingListView;->inLoading()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 128
    :goto_0
    return-void

    .line 122
    :cond_0
    const/4 v0, 0x1

    iput v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mState:I

    .line 123
    iput p1, p0, Lcom/netease/newsreader/view/LoadingListView;->mTempPage:I

    .line 124
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mListView:Landroid/widget/ListView;

    invoke-direct {p0, v0, v2}, Lcom/netease/newsreader/view/LoadingListView;->setViewVisibility(Landroid/view/View;I)V

    .line 125
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingView:Landroid/view/View;

    const/16 v1, 0x8

    invoke-direct {p0, v0, v1}, Lcom/netease/newsreader/view/LoadingListView;->setViewVisibility(Landroid/view/View;I)V

    .line 126
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingMoreView:Landroid/view/View;

    invoke-direct {p0, v0, v2}, Lcom/netease/newsreader/view/LoadingListView;->setViewVisibility(Landroid/view/View;I)V

    .line 127
    iget-object v0, p0, Lcom/netease/newsreader/view/LoadingListView;->mLoadingMoreView:Landroid/view/View;

    invoke-direct {p0, v0, v2}, Lcom/netease/newsreader/view/LoadingListView;->setViewEnabled(Landroid/view/View;Z)V

    goto :goto_0
.end method
